<?php

require_once("../../class2.php");
require_once(HEADERF);
		$user_id = USERID;
		$user_name = USERNAME;
require_once("./includes/require_all.php");

ramka("open");


if ($_GET['slct']=='all') { $gettodos="SELECT * FROM cms_todos WHERE status=0 ORDER BY todo ASC"; $echo1='Остават: '; $echo2='Завършени: '; }
elseif (isset($_GET['slct'])) { $gettodos="SELECT * FROM cms_todos WHERE status=0 ORDER BY added DESC LIMIT 0,".mysql_real_escape_string($_GET['slct']).""; }
else $gettodos="SELECT * FROM cms_todos WHERE status=0 ORDER BY added DESC LIMIT 0,5";
$todos=mysql_query($gettodos);

if($_GET['slct'] == 'all'){
	echo "<div id='result'><div class='forumheader3 textGREEN'>$echo1".mysql_num_rows($todos)."</div>";
}
else{
	echo "<div id='result'><div class='forumheader3 textGREEN'>$echo1</div>";
}
While ($rowed=mysql_fetch_array($todos)) {
	$echoed=explode(": ", $rowed[todo], 2);
	echo "<div class='forumheader2 textWHITE' style='padding:0px 0px 0px 10px;'>$echoed[0]: <span class='textGREY'>$echoed[1]</span></div>";
}
unset($todos);

$gettodos="SELECT * FROM cms_todos WHERE status=1 ORDER BY added DESC";
$todos=mysql_query($gettodos);

if($_GET['slct'] == 'all'){
	echo "<div class='forumheader3 textGREEN'>$echo2".mysql_num_rows($todos)."</div></div>";
}
else{
	echo "<div class='forumheader3 textGREEN'>$echo2</div></div>";
}
While ($rowed=mysql_fetch_array($todos)) {
	$echoed=explode(": ", $rowed[todo], 2);
	echo "<div class='forumheader2 textWHITE' style='padding:0px 0px 0px 10px; text-decoration:line-through;'>$echoed[0]: <span class='textGREY'>$echoed[1]</span></div>";
}
echo "<div class='forumheader3 textGREEN'></div></div>";

ramka("close");

require_once(FOOTERF);
?>